<template>
  <el-form-item v-show="isShow" prop="widthLine" :label="i18nt('designer.setting.widthLine')">
    <el-input-number
      v-model="optionModel.widthLine"
      class="hide-spin-button"
      style="width: 100%"
      :min="0"
      :step="1"
      :max="10"
      :disabled="disabled"
    ></el-input-number>
  </el-form-item>
</template>

<script>
export default {
  name: 'WidthLineEditor',
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
    disabled: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    isShow() {
      // 当组件为staticText, 并且isSetSize为false时，不显示
      if (
        this.selectedWidget &&
        this.selectedWidget.type === 'staticText' &&
        this.optionModel.isSetSize === false
      ) {
        return false
      }

      return true
    }
  }
}
</script>

<style scoped></style>
